package com.kstech.mp3604.fragments

import com.blankii.androidlibrary.base.BaseBindingFragment
import com.kstech.mp3604.databinding.FragmentTestSendSocketBinding
import com.kstech.mp3604.manager.socket.SocketRespondMsgListener
import com.kstech.mp3604.manager.socket.SocketStatusListener

class TestSendSocketFragment :
    BaseBindingFragment<FragmentTestSendSocketBinding>(FragmentTestSendSocketBinding::inflate),
    SocketStatusListener, SocketRespondMsgListener {
    private val stringBuilder = StringBuilder()
    override fun onCreateInit() {
//        SocketManager.addRespondMsg(this)
    }

    override fun onInitView() {
        binding.apply {
            button4.setOnClickListener {
                val ip = editTextText.text.toString().trim()
                val port = editTextText2.text.toString().trim()
//                SocketManager.initEasySocket(
//                    requireContext(), this@TestSendSocketFragment, ip, port.toInt()
//                )
            }
        }
    }

    override fun success() {
        "连接成功".showSnackBar()
    }

    override fun fail() {
        "连接失败".showSnackBar()
    }

    override fun disConnect() {
        "连接断开".showSnackBar()
    }

    override fun gsonFail(e: String) {

    }

    override fun msgRespond(str: String?) {

    }

}